package org.anyin.gitee.cloud.lib.core.exceptions;

import lombok.Getter;
import org.anyin.gitee.cloud.lib.core.enums.CommonExCodeEnum;

@Getter
public class CommonException extends RuntimeException{

    private String errorCode;
    private String errorMessage;

    public CommonException(CommonExCodeEnum exCode){
        super(exCode.getCode() + ":" + exCode.getMessage());
        this.errorCode = exCode.getCode();
        this.errorMessage = exCode.getMessage();
    }

    public CommonException(String code, String message){
        super(code + ":" + message);
        this.errorCode = code;
        this.errorMessage = message;
    }
}
